<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .classA{
      color:red;
    }
    .classB{
      background: blue;
    }
    .classC{
      font-size:35px;
    }
  </style>
</head>
<body>
  <div id='demo'> 
    <h2 >1.class绑定</h2>
       <p class="classA" :class="myClass">看我你在什么</p>
       <p :class='["classA", "classB" ]'>xxxxx</p>
       <p class="classA" :class="{classB:isB,classC:isC}">看我你在什么</p>
    <h2>2.style绑定</h2>
    <p :style="{color:myColor,fontSize:mySize+'px'}">zzzzz</p>
    <button @click='update'>更新</button>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    new Vue({
       data(){
         return{
          myClass:'classB',
          isB:true,
          isC:false,
          myColor:'pink',
          mySize:30
         }
       },
       methods:{
         update(){
           this.myClass='classC'
           this.isB=!this.isB
           this.isC=!this.isC
           this.myColor='green'
           this.mySize +=5
         }
       }

    }).$mount('#demo')
  </script>
</body>
</html>